import ajax from './ajax'

// 请求用户信息
export const reqCategory = () => {
  return ajax({
    url: '/category',
    method: 'get'
  })
}

// 获取分类的列表数据
export const reqCateDetail = (id, page, pagesize) => {
  return ajax({
    url: `/detail/${id}`,
    method: 'get',
    params:{
      page,
      pagesize
    }
  })
}

// 获取视频的详细数据
export const reqVideoDetail = (id) => {
  return ajax({
    url: `/article/${id}`,
    method: 'get'
  })
}

// 获取推荐视频的数据
export const reqHotVideo = () => {
  return ajax({
    url: '/commend',
    method: 'get'
  })
}

// 获取评论的数据
export const reqrecommended = (id) => {
  return ajax({
    url: `/comment/${id}`,
    method: 'get'
  })
}

// 添加评论数据
export const reqAddCommended= (id, comment_content, comment_date, parent_id, article_id) => {
  return ajax({
    url: `/comment_post/${id}`,
    method: 'POST',
    data:{
      comment_content,
      comment_date,
      parent_id,
      article_id
    }
  })
}